/*
 * Powered By dico
 * Since 2017 - 2018
 */package com.seeyoui.kensite.bussiness.exam.groupUser.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seeyoui.kensite.common.base.service.BaseService;

import java.util.*;

import com.seeyoui.kensite.common.base.domain.EasyUIDataGrid;
import com.seeyoui.kensite.common.base.service.BaseService;
import com.seeyoui.kensite.common.exception.CRUDException;
import com.seeyoui.kensite.common.util.*;
import com.seeyoui.kensite.common.constants.StringConstant;
import com.seeyoui.kensite.bussiness.exam.groupUser.domain.GroupUser;
import com.seeyoui.kensite.bussiness.exam.groupUser.persistence.GroupUserMapper;

/**
 * GroupUser
 * @author dico
 * @version 2.0
 * @since 1.0
 * @date 2018-01-02
 */

@Service
public class GroupUserService extends BaseService {
	
	@Autowired
	private GroupUserMapper groupUserMapper;

	/**
	 * 根据ID查询单条数据
	 * @param id
	 * @return
	 * @throws CRUDException
	 */
	public GroupUser findOne(String id) throws CRUDException{
		return groupUserMapper.findOne(id);
	}
	
	/**
	 * 查询数据集合
	 * @param groupUser
	 * @return
	 * @throws CRUDException
	 */
	public List<GroupUser> findList(GroupUser groupUser) throws CRUDException {
		return groupUserMapper.findList(groupUser);
	}
	
	/**
	 * 查询所有数据集合
	 * @param groupUser
	 * @return
	 * @throws CRUDException
	 */
	public List<GroupUser> findAll(GroupUser groupUser) throws CRUDException {
		return groupUserMapper.findAll(groupUser);
	}
	
	/**
	 * 查询数据总数
	 * @param groupUser
	 * @return
	 * @throws CRUDException
	 */
	public int findTotal(GroupUser groupUser) throws CRUDException {
		return groupUserMapper.findTotal(groupUser);
	}
	
	/**
	 * 查询数据总数排除当前数据
	 * @param groupUser
	 * @return
	 * @throws CRUDException
	 */
	public int findExTotal(GroupUser groupUser) throws CRUDException {
		return groupUserMapper.findExTotal(groupUser);
	}
	
	/**
	 * 数据新增
	 * @param groupUser
	 * @throws CRUDException
	 */
	public void save(GroupUser groupUser) throws CRUDException{
		groupUser.preInsert();
		groupUserMapper.save(groupUser);
	}
	
	/**
	 * 数据修改
	 * @param groupUser
	 * @throws CRUDException
	 */
	public void update(GroupUser groupUser) throws CRUDException{
		groupUser.preUpdate();
		groupUserMapper.update(groupUser);			
	}
	
	/**
	 * 数据删除
	 * @param listId
	 * @throws CRUDException
	 */
	public void delete(List<String> listId) throws CRUDException {
		groupUserMapper.delete(listId);
	}
	
	/**
	 * 数据假删除
	 * @param groupUser
	 * @throws CRUDException
	 */
	public void remove(GroupUser groupUser) throws CRUDException{
		groupUser.preUpdate();
		groupUserMapper.remove(groupUser);			
	}
	
}